

#[derive(Debug)]
pub struct DmaConfig {
    pub dma: u8,
    pub ch: u8,
    pub size: u8,
}

pub fn parse(attr: &str) -> DmaConfig {
    let attrs: Vec<&str> = attr.split("_").collect();
    let dma = attrs[0];
    let dma: u8 = (&dma[3..]).parse().unwrap();
    let ch = attrs[1];
    let ch: u8 = (&ch[2..]).parse().unwrap();
    let size = attrs[2];
    let size: u8 = (&size[4..]).parse().unwrap();
    DmaConfig { dma, ch, size }
}
